<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="UTF-8">
    <title>原始样式</title>
    <style>
    body {
        margin: 0;
    }

    input {
        padding: 0;
        margin: 0;
        border: 0;
    }

    .female,
    .male {
        position: relative;
        height: 40px;
        line-height: 40px;
        margin-left: 40px;
    }

    .sex label {
        display: block;
        height: 40px;
        width: 40px;
        line-height: 40px;
        font-size: 20px;
        cursor: pointer;
    }

    .sex input {
        z-index: 3;
        position: absolute;
        top: 0;
        bottom: 0;
        left: 40px;
        margin: auto;
        display: block;
        width: 30px;
        height: 30px;
        cursor: pointer;
    }
    </style>
</head>

<body>
    <form action="">
        <div class="sex">
            <div class="female">
                <label for="female">女</label>
                <input type="radio" name="sex" id="female">
            </div>
            <div class="male">
                <label for="male">男</label>
                <input type="radio" name="sex" id="male">
            </div>
        </div>
    </form>
</body>

</html>